package com.PictureSite.model;

import java.util.ArrayList;
import java.util.List;

public class UserPost {
	
	public UserPost() {
		this.votes = 0;
	}
	
	private String userIp;

	private String title;

	private String userName;
	
	private String datePosted;
	
	private String pictureLink;
	
	private int votes;
	
	private String blobId;
	
	private String id;
	
	private List<Voter> voters;
	
	//null = no votes
	//true = upVote
	//false = downVote
	private Boolean voteType;
	
	public String getUserIp() {
		return userIp;
	}

	public void setUserIp(String userIp) {
		this.userIp = userIp;
	}
	
	public Boolean getVoteType() {
		return voteType;
	}

	public void setVoteType(Boolean voteType) {
		this.voteType = voteType;
	}

	public List<Voter> getVoters() {
		return voters;
	}
	
	public void setVoters(List<Voter> voters) {
		this.voters = voters;
	}

	public String getId() {
		return id;
	}

	public void setId(String l) {
		this.id = l;
	}

	public String getBlobId() {
		return blobId;
	}

	public void setBlobId(String blobId) {
		this.blobId = blobId;
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getDatePosted() {
		return datePosted;
	}

	public void setDatePosted(String string) {
		this.datePosted = string;
	}

	public String getPictureLink() {
		return pictureLink;
	}

	public void setPictureLink(String pictureLink) {
		this.pictureLink = pictureLink;
	}

	public int getVotes() { return votes; }
	
	public void upvote() { votes += 1; }
	
	public void downvote() { votes -= 1; }

	public void setVotes(int votes) {
		this.votes = votes;
	}
	
}
